home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / G4C / CED / AddLink.g < prev    next >
Encoding:
Gui4CLI script  |  1999-11-24  |  3.4 KB  |  160 lines

  1. G4C
  2.  
  3. WINBIG 199 27 442 35 "Link selection to:"
  4. WinType 11110001
  5. resinfo 8 640 256
  6.  
  7. BOX 0 0 0 0 out button
  8.  
  9. xOnLoad
  10. linkmode = NODE
  11. guiopen addlink.g
  12.  
  13. xonreload
  14. guiopen addlink.g
  15.  
  16. xonopen
  17. linkname = ''
  18. update addlink.g 1 ''
  19.  
  20. xONQUIT
  21. guiquit getlinkmode
  22.  
  23. ; -------------------------------------------------------------
  24. ;       Get link name
  25. ; -------------------------------------------------------------
  26.  
  27. XTEXTIN 5 3 433 14 "" linkname "" 140
  28. gadhelp 'Enter the name of the node or file or rexx script'
  29. gadid 1
  30. gosub addlink.g dolink
  31.  
  32. XBUTTON 276 18 80 13 "Browse.."
  33. gadhelp 'Select node or file through a requester'
  34. docase $linkmode
  35.   case = NODE
  36.     ; get current filename
  37.     sendrexx $cedbar.gc/cedport 'status filename'
  38.     filename = $$rexxret
  39.     extract filename PATH filepath
  40.     extract filename FILE filename
  41.     ReqFile -1 -1 300 -40 "Select Node" LOAD linkname #$filepath
  42.     extract linkname file linkname
  43.     update addlink.g 1 $linkname
  44.     break
  45.   case = FILE
  46.     ReqFile -1 -1 300 -40 "Select File" LOAD linkname sys:
  47.     JoinFile $linkname "MAIN" linkname
  48.     update addlink.g 1 $linkname
  49.     break
  50.   case = SYSTEM
  51.     ReqFile -1 -1 300 -40 "Select Command" LOAD linkname c:
  52.     update addlink.g 1 $linkname
  53.     break
  54.   case = RX
  55.     ReqFile -1 -1 300 -40 "Select Rexx script" LOAD linkname sys:
  56.     update addlink.g 1 $linkname
  57.     break
  58.   case = RXS
  59.     ;
  60.     break
  61. endcase
  62. setgad addlink.g 1 ON
  63.  
  64. ; -------------------------------------------------------------
  65. ;       OK..
  66. ; -------------------------------------------------------------
  67.  
  68. XBUTTON 357 18 80 13 "OK"
  69. gadhelp 'Proceed..'
  70. gadkey #13
  71. gosub addlink.g dolink
  72.  
  73. ; do the actual link insertion - also called from the textin
  74. xRoutine dolink
  75. guiclose addlink.g
  76. if $linkname > ' '
  77.   SendRexx $cedbar.gc/cedport cut
  78.   SendRexx $cedbar.gc/cedport 'text @{\" '
  79.   SendRexx $cedbar.gc/cedport paste
  80.   SendRexx $cedbar.gc/cedport 'text  \" '
  81.   if $linkmode = NODE
  82.   or $linkmode = FILE
  83.     SendRexx $cedbar.gc/cedport 'text LINK \"$linkname\"}'
  84.   else
  85.     SendRexx $cedbar.gc/cedport 'text $linkmode \"$linkname\"}'
  86.   endif
  87. endif
  88.  
  89. ; -------------------------------------------------------------
  90. ;       Choose type of link
  91. ; -------------------------------------------------------------
  92.  
  93. CTEXT 6 18 "Type:" #screen 8 2 0 00011
  94.  
  95. TEXT 75 18 195 13 'Link to Node' 100 BOX
  96. gadhelp 'Displays the link type'
  97. gadid 2
  98.  
  99. XBUTTON 48 18 23 13 "?"
  100. gadhelp 'Change link type'
  101. guiopen getlinkmode
  102.  
  103.  
  104. ; #############################################################
  105. ;       GETLINKMODE
  106. ; #############################################################
  107.  
  108. NEWFILE getlinkmode
  109. WINBIG 156 78 158 61 ''
  110. WinType 00001000
  111. winonmouse 15 15
  112. resinfo 8 660 270
  113. varpath addlink.g
  114. BOX 0 0 0 0 out button
  115.  
  116. xONRMB
  117. guiclose getlinkmode
  118.  
  119. xONInactive
  120. guiclose getlinkmode
  121.  
  122. XRADIO 10 5 17 9 linkmode 2
  123. gadhelp 'Choose type of link'
  124. gadtitle right
  125. RSTR "Link to Node" NODE
  126. RSTR "Link to File" FILE
  127. RSTR "Run Command" SYSTEM
  128. RSTR "Run Rexx script" RX
  129. RSTR "Run Rexx line" RXS
  130. guiclose getlinkmode
  131. docase $linkmode
  132.   case = NODE
  133.     update addlink.g 2 'Link to Node'
  134.     break
  135.   case = FILE
  136.     update addlink.g 2 'Link to File'
  137.     break
  138.   case = SYSTEM
  139.     update addlink.g 2 'Run Command'
  140.     break
  141.   case = RX
  142.     update addlink.g 2 'Run Rexx script'
  143.     break
  144.   case = RXS
  145.     update addlink.g 2 'Run Rexx line'
  146.     break
  147. endcase
  148. ; reset any entries since we've changed mode
  149. linkname = ''
  150. update addlink.g 1 ''
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.